package com.ruoyi;

import org.springframework.beans.factory.annotation.AnnotatedBeanDefinition;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.context.annotation.AnnotationBeanNameGenerator;
import org.springframework.util.StringUtils;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class WebAppliaction {

	public static class SpringBeanNameGenerator extends AnnotationBeanNameGenerator {
		@Override
		protected String buildDefaultBeanName(BeanDefinition definition) {
			if (definition instanceof AnnotatedBeanDefinition) {
				String beanName = determineBeanNameFromAnnotation((AnnotatedBeanDefinition) definition);
				
				if (StringUtils.hasText(beanName)) {
					// Explicit bean name found.
					return beanName;
				}
			}
			String text = definition.getBeanClassName();
			System.out.println(text);
			return text;
		}
	}

	public static void main(String[] args) {
		SpringApplication.run(WebAppliaction.class, args);
		System.out.println("(♥◠‿◠)ﾉﾞ  若依启动成功   ლ(´ڡ`ლ)ﾞ  \n" + " .-------.       ____     __        \n" + " |  _ _   \\      \\   \\   /  /    \n" + " | ( ' )  |       \\  _. /  '       \n" + " |(_ o _) /        _( )_ .'         \n" + " | (_,_).' __  ___(_ o _)'          \n" + " |  |\\ \\  |  ||   |(_,_)'         \n" + " |  | \\ `'   /|   `-'  /           \n" + " |  |  \\    /  \\      /           \n" + " ''-'   `'-'    `-..-'              ");
	}
}